Skip to content

feat(installer): read Node task slugs from tasks.json#70

Merged
derek-palmer merged 1 commit into
mainfrom
feat/node-installer-tasks-json
May 29, 2026
Merged

feat(installer): read Node task slugs from tasks.json#70
derek-palmer merged 1 commit into
mainfrom
feat/node-installer-tasks-json

Conversation

@derek-palmer
Copy link
Copy Markdown
Owner

Wires the Node installer to the Task Registry so it stops duplicating the Python slug list.

What

  • bin/install.js: drop hardcoded TASK_SKILL_SLUGS; load slugs from src/codeforerunner/tasks.json at install time via loadTaskSkillSlugs(), mirroring Python tasks.installable_slugs() (canonical slug first, then per-task skill_slug in registry order, deduped).
  • Shared the HTTPS fetch as fetchRawText() (reused by fetchSkill + the loader); local-first, HTTPS fallback.
  • package.json: ship tasks.json in the npm tarball; add npm test (node --test).
  • .github/workflows/ci.yml: add setup-node + npm test; node now precedes pytest (the parity test shells out to it).
  • Guard: reject a registry missing canonical_skill_slug (matches Python KeyError).

Why

bin/install.js mirrored the Python list by hand — a live drift hazard. #45 (Task Registry) landed in #66, making tasks.json the source of truth, so the Node side can now read it.

Tests

  • tests/install.test.js (new, 8 node:test behaviors): parser (canonical-first, dedup, skip-null, order, malformed→throw, missing-canonical→throw), local read, and a subprocess test asserting the CLI exits non-zero when the registry is unreadable.
  • tests/test_installer.py: Node↔Python slug parity (spawns node, skips if absent).

Acceptance (#65)

  • reads tasks.json, no hardcoded list
  • produces the same list as installable_slugs()
  • same skills installed, same destinations

Follow-up filed: #69 (cap redirects in fetchRawText).

Closes #65

bin/install.js hardcoded TASK_SKILL_SLUGS, duplicating the Python
installer's list — the two drifted independently. Read the Task
Registry (tasks.json) at install time instead, mirroring
tasks.installable_slugs(). Now unblocked: #45 landed tasks.json.

- ship tasks.json in npm tarball so packaged installs can read it
- add npm test (node:test) + wire node setup into ci.yml
- reject registry missing canonical_skill_slug, matching Python

Closes #65

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@derek-palmer derek-palmer merged commit 2dea1fb into main May 29, 2026
10 checks passed
@derek-palmer derek-palmer deleted the feat/node-installer-tasks-json branch May 29, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire Node installer to read task slugs from tasks.json

1 participant